<template>
  <div class="customInstructionWrap">
    <h2>Teleport标签</h2>
    <h4 class="tempDemo">示例一：传送模态框到body标签下</h4>
    <button @click="show = true">显示模态框</button>
    <teleport to="body">
      <div class="fullScreen" v-show="show">
        <div class="innerBox">
          <button @click="show = false">关闭模态框</button>
        </div>
      </div>
    </teleport>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  components: {},
  data() {
    return {
      show: false,
    };
  },
  methods: {},
});
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.fullScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
